<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>
    我的拼团
    <switch name="status" >
        <case value="9">-待付款</case>
        <case value="1">-待成团</case>
        <case value="2">-待评价</case>
        <case value="3">-拼团失败</case>
        <case value="4">-待发货</case>
        <case value="5">-待收货</case>
        <case value="6">-待核销</case>
        </default>-全部订单
    </switch>
</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Wx/css/base.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Wx/css/index.css" />
</head>
<body> 
<div class="order">
    <div class="tabber">
        <a href="__CONTROLLER__/"><span class="<?=$status==''?'on':''?>">全部</span></a>
        <a href="__CONTROLLER__/index/type/9"><span class="<?=$status==9?'on':''?>">待付款</span></a>
        <a href="__CONTROLLER__/index/type/1"><span class="<?=$status==1?'on':''?>">待成团</span></a>
        <a href="__CONTROLLER__/index/type/4"><span class="<?=$status==4?'on':''?>">待发货</span></a>
        <a href="__CONTROLLER__/index/type/6"><span class="<?=$status==6?'on':''?>">待核销</span></a>
        <a href="__CONTROLLER__/index/type/2"><span class="<?=$status==2?'on':''?>">待评价</span></a>
    </div>
    <div class="orderlist">
    	<div class="block">
            <ul>
                <volist name="list" id="vo">
                <li>
                	<div class="tit">
                        订单状态
                        <span>
                            <switch name="vo.state" >
                                <case value="0">待付款</case>
                                <case value="1">待成团</case>
                                <case value="2">待评价</case>
                                <case value="3">拼团失败</case>
                                <case value="4">待发货</case>
                                <case value="5">待收货</case>
                                <case value="6">待核销</case>
                                <case value="7">已评价</case>
                                <case value="8">已取消</case>
                            </switch>
                        </span>
                    </div>

                    <div class="pro" onClick="window.location='/Wx/MyGrouporder/orderdetail/id/{$vo.id}'">
                        <div class="pic">
                            <a href="<?=U('MyGrouporder/orderdetail',array('id'=>$vo['id']))?>">
                                <img src="<?=$vo['goods_info']['h_imgs']?>"/>
                            </a>
                        </div>
                        <div class="name">
                            <h2><b class="<eq name="vo.goods_info.type" value="0">xc<else/>md</eq>"><?=$vo['goods_info']['type']==0?'乡村':'门店'?></b><?=$vo['goods_info']['title']?></h2>
                            <p>
                                <b><img src="<?=$vo['store_info']['avatar']?>"/></b>
                                <i><?=$vo['store_info']['nickname']?></i>
                                <em>
                                    <?=$vo['store_info']['storename']?>
                                </em>
                            </p>
                            <h3>
                                <del>原价：￥<?=$vo['goods_info']['price']?></del>
                                <em>￥<?=$vo['total_fee']!=0.00?$vo['total_fee']:$vo['card_fee']?></em>
                                <switch name="vo.state" >
                                    <case value="1">
                                        <i>还差<b><?=$vo['goods_info']['min_num']-$vo['num']?></b>份成团</i>
                                    </case>
                                </switch>
                            </h3>
                        </div>
                    </div>

                    <switch name="vo.state" >
                        <case value="0">
                            <div class="button">
                            <input type="button" class="left02" onClick="cancle({$vo.id})" value="取消订单"/>
                            <input type="button" onClick="window.location='/Api/Weixinpay/choosePay?order_id={$vo.id}'" value="立即付款"/>
                            </div>
                        </case>
                        <case value="2">
                            <div class="button">
                            <input type="button" onClick="window.location='/Wx/MyGrouporder/addEva/order_id/{$vo.id}/sg_id/{$vo.sg_id}'" value="待评价"/>
                            </div>
                        </case>
                    </switch>

                </li>
                </volist>
            </ul>
        </div>
    </div>

    <!--引用悬浮公共导航文件-->
    <include file="Public:nav" />

</div>
	<!--<script type="text/javascript" src="__PUBLIC__/Wx/js/jquery-1.3.1.min.js"></script>-->
    <script src="__PUBLIC__/Wx/js/jquery.js" ></script>
    <script src="__PUBLIC__/js/layer/layer.js"></script>
	<script type="text/javascript">
		function cancle($order_id) {
            $.post('/Wx/MyGrouporder/cancle',{order_id:$order_id},function (data) {
                //提交成功后调用
                if(data.status==1) {
                    layer.msg(data.info, {icon:1,time:1000}, function(){
                            window.location.reload();
                        });
                }else{
                    layer.msg(data.info, {icon:2,time:1000});
                }
            })
        }
        $(".click span").click(function(){
            if($(this).text() ==="导航"){
                $(this).text("收起");
                $('.link02').css('display','block')
            }else{
                $(this).text("导航");
                $('.link02').css('display','none')
            }
        });
	</script>
</body>
</html>